<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="java.util.List"%>
<%@page import="java.util.ArrayList"%>
<%@page import="com.is.control.ParamStuyearControl"%>
<%@page import="com.is.model.ParamStuyear"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../../resources/css/user_info.css" />
<style type="text/css">
	table{width:90%;
	margin:20px auto 0px;
	border-collapse:collapse; 
	border-spacing:0; 
	border-padding:0;}
	table tr td{border:1px solid #ccc; padding:4px; text-align:center;}
	.span{display:inline-block; margin-left:10px; height:28px;}
	.list{width:200px;}
</style>
<script type="text/javascript" src="../../resources/js/jquery-1.8.1.js"></script>
<title>Insert title here</title>
<style type="text/css">
</style>
<script type="text/javascript">
	$(function(){
		$("[name='fromStuyear']").change(function(){
			var selectVal = $(this).val();
			$.ajax({
				method:"post",
				dataType:"html",
				cache:false,
				url:"getClasses.jsp",
				data:{
					stuYear:selectVal
				},
				success:function(data){
					$(".list").html("");
					$(".list").append(data);
				}
			})
		})
	})
</script>
</head>
<body>

</body>
<form action="copyClasses.jsp" method="post">
	<table>
	<caption>请选择年级</caption>
		<tr>
			<td>学期</td>
			<td><select name="fromStuyear">
				<% 
					request.setCharacterEncoding("UTF-8");
					response.setCharacterEncoding("UTF-8");
					List<ParamStuyear> list = new ArrayList<ParamStuyear>();
					list = ParamStuyearControl.getAllStuyear(); 
					for(int i = 0; i < list.size();i++){
				%>
						<option value="<%=list.get(i).getId() %>"><%=list.get(i).getStuyear() %></option>
				<%
					}
				%>
					</select>
			</td>
			<td><input type="submit" value="确定"/></td>
		</tr>
		<tr>
			<td>班级</td>
			<td class="list" colspan="2">
			
			</td>
		</tr>
	</table>
</form>
</html>